<!DOCTYPE HTML>
<html>
<head>
    <title>我要服务</title>
    <% include common/meta.ejs %>
    <% include common/public.ejs %>
    <style>
        .weui_panel{
            overflow-y: scroll;
            height:100%;
            width: 100%;
        }
    </style>
</head>
<body ontouchstart="">
<div class="weui_tab">
    <div class="weui_navbar">
        <a class="weui_navbar_item weui_bar_item_on" href="bill?openId=<%= session.openId %>">
            账单
        </a>
        <a class="weui_navbar_item" href="repairList?openId=<%= session.openId %>">
            报修
        </a>
        <a class="weui_navbar_item" href="clean?openId=<%= session.openId %>">
            保洁
        </a>
    </div>
    <div class="weui_panel">
        <div style="height: 35px;"></div>
        <div class="weui_panel_hd">所有账单</div>
        <div class="weui_panel_bd">
        <% for(var i = 0;i < data.length;i++) { %>
        <div class="weui_media_box weui_media_text">
            <div class="weui_media_title"><strong><%= data[i].name %></strong>
            </div>
            <div class="weui_media_desc">
                <p><span>创建日期<%= data[i].createdDate.substr(0,10) %></span>，
                    合计金额：<%= data[i].actualAmount %>
                    <span style="float: right;"><%= data[i].status==1?'已支付':'待支付' %></span></p>
            </div>

            <div class="weui_media_info">
                <div>费用明细：</div>
                <% if(data[i].type == '1') {%>
                <div style="margin-left: 1rem;">&#45;&#45;房租费&nbsp;<%= data[i].rentalAmount %></div>
                <div style="margin-left: 1rem;">&#45;&#45;押金费&nbsp;<%= data[i].pledgeAmount %></div>
                <% } else if(data[i].type == '2') {%>
                <div style="margin-left: 1rem;">&#45;&#45;水费&nbsp;<%= data[i].waterNum %>-<%= data[i].preWater %> * <%= data[i].waterPrice %> = <%= data[i].waterAmount %></div>
                <div style="margin-left: 1rem;">&#45;&#45;电费&nbsp;<%= data[i].electricNum %>-<%= data[i].preElectric %> * <%= data[i].electricPrice %> = <%= data[i].electricAmount %></div>
                <div style="margin-left: 1rem;">&#45;&#45;燃气费&nbsp;<%= data[i].gasNum %>-<%= data[i].preGas %> * <%= data[i].gasPrice %> = <%= data[i].gasAmount %></div>
                <% } %>
                <div style="margin-left: 1rem;">&#45;&#45;其他&nbsp;<%= data[i].otherFee || '0' %></div>
            </div>
        </div>
        <%}%>
            <div style="height: 60px;"></div>
        </div>
    </div>
    <% if(!data.length) { %>
    <div style="padding: 10px 20px;font-size: 13px;">暂无账单数据</div>
    <% } %>
    <div class="weui_tabbar">
        <a href="index?openId=<%= session.openId %>" class="weui_tabbar_item weui_bar_item_on">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_toast.png" alt="">
            </div>
            <p class="weui_tabbar_label">我要租房</p>
        </a>
        <a href="news?openId=<%= session.openId %>" class="weui_tabbar_item">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_button.png" alt="">
            </div>
            <p class="weui_tabbar_label">科寓动态</p>
        </a>
        <a href="account?openId=<%= session.openId %>" class="weui_tabbar_item">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_photo.png" alt="">
            </div>
            <p class="weui_tabbar_label">我</p>
        </a>
    </div>
</div>
<% include common/footer.ejs %>
<script src="<%= global.config.mode %>/Swiper/3.3.1/js/swiper.jquery.<%= global.config.mode %>js"></script>
</body>
</html>